package com.nit.store.service;

import com.nit.store.pojo.dto.output.OrderDto;
import com.nit.store.pojo.entity.Order;
import com.nit.store.pojo.entity.OrderItem;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @Author J1ay
 * @Date 2022/7/21 20:50
 * @Description
 */

public interface OrderService {
    /**
     * 创建订单
     * @param aid aid
     * @param cids cid数组
     * @param uid uid
     * @param username username
     */
    @Transactional(rollbackFor = Exception.class)
    void createOrder(Long aid, Long[] cids, long uid, String username);


    /**
     * 获取个人订单
     * @param uid
     * @return
     */
    List<OrderDto> getOrderList(int status, Long uid);


    /**
     * 删除订单
     * @param oid
     */
    void delete(long oid);

    /**
     * 删除订单中的商品
     * @param oid
     * @param pid
     */
    void deleteItem(long oid, long pid);
}
